package com.yricky.atri.utils.yolov5

import android.graphics.RectF

/**
 * @author Yricky
 * @date 2022/1/9
 */

class Recognition(
    /**
     * A unique identifier for what has been recognized. Specific to the class, not the instance of
     * the object.
     */
    val id: String,
    /**
     * Display name for the recognition.
     */
    val title: String,
    /**
     * A sortable score for how good the recognition is relative to others. Higher should be better.
     */
    val confidence: Float,
    /**
     * Optional location within the source image for the location of the recognized object.
     */
    var location: RectF,
    val detectedClass:Int = 0

) {
    override fun toString(): String {
        var resultString = ""
        resultString += "[$id] "
        resultString += "$title "
        resultString += String.format("(%.1f%%) ", confidence * 100.0f)
        resultString += "$location "
        return resultString.trim { it <= ' ' }
    }
}

